package com.badlgic.androidgames;

import org.anddev.andengine.engine.Engine;
import org.anddev.andengine.engine.camera.Camera;
import org.anddev.andengine.engine.options.EngineOptions;
import org.anddev.andengine.engine.options.EngineOptions.ScreenOrientation;
import org.anddev.andengine.engine.options.resolutionpolicy.RatioResolutionPolicy;
import org.anddev.andengine.entity.scene.Scene;
import org.anddev.andengine.entity.sprite.Sprite;
import org.anddev.andengine.entity.util.FPSLogger;
import org.anddev.andengine.opengl.texture.TextureOptions;
import org.anddev.andengine.opengl.texture.atlas.bitmap.BitmapTextureAtlas;
import org.anddev.andengine.opengl.texture.atlas.bitmap.BitmapTextureAtlasTextureRegionFactory;
import org.anddev.andengine.opengl.texture.region.TextureRegion;
import org.anddev.andengine.ui.activity.BaseGameActivity;

public class HighScores extends BaseGameActivity{
	
	private static final int CAMERA_WIDTH = 768;
	private static final int CAMERA_HEIGHT = 1024;
	private String tag = "HighScores";
	
	private BitmapTextureAtlas mHighScoresBitmapTextureAtlas;
	private TextureRegion mHighScoresTextureRegion;
	
	private Camera mCamera;
	
	@Override
	public Engine onLoadEngine() {
		this.mCamera = new Camera(0, 0, CAMERA_WIDTH, CAMERA_HEIGHT);
		return new Engine(new EngineOptions(true, ScreenOrientation.PORTRAIT, new RatioResolutionPolicy(CAMERA_WIDTH, CAMERA_HEIGHT), this.mCamera));
	}

	@Override
	public void onLoadResources() {
		mHighScoresBitmapTextureAtlas = new BitmapTextureAtlas(1024, 1024, TextureOptions.BILINEAR_PREMULTIPLYALPHA);
		mHighScoresTextureRegion = BitmapTextureAtlasTextureRegionFactory.createFromAsset(this.mHighScoresBitmapTextureAtlas, this, "gfx/hight_score.jpg", 0, 0);
		
		this.mEngine.getTextureManager().loadTexture(mHighScoresBitmapTextureAtlas);
	}

	@Override
	public Scene onLoadScene() {
		this.mEngine.registerUpdateHandler(new FPSLogger());
		
		Scene scene = new Scene();
		
		final Sprite sprite = new Sprite(0, 0, this.mHighScoresTextureRegion);
		scene.attachChild(sprite);
		
		return scene;
	}

	@Override
	public void onLoadComplete() {
		
	}

}
